﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace AllenalaMente.Games.Recall
{
    public partial class Item : UserControl
    {
        public bool isNone = false;
        public bool isVisible = false;

        public Item(int i, int size)
        {
            InitializeComponent();

            string ImagePath = "/AllenalaMente;component/Assets/Images/Items/Item0" + i + ".png";

           
            if (i == 0)
            {
                ImagePath = "/AllenalaMente;component/Assets/Images/Items/ItemNone.png";

                isNone = true;
                isVisible = true;
            }

            // Carica Immagine
            Uri uri = new Uri(ImagePath, UriKind.Relative);
            ImageSource img = new System.Windows.Media.Imaging.BitmapImage(uri);
            image.SetValue(Image.SourceProperty, img);

            LayoutRoot.Width = size;
            LayoutRoot.Height = size;

            image.Width = size - 20;
            image.Height = size - 20;

            Canvas.SetLeft(image, 10 + Canvas.GetLeft(image));
            Canvas.SetTop(image, 10 + Canvas.GetTop(image));
        }
    }
}
